home *** CD-ROM | disk | FTP | other *** search
- /*
- * SFskyedit - Star Fighter 3000 sky colours editor
- * File info window
- * Copyright (C) 2001 Chris Bazley
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public Licence as published by
- * the Free Software Foundation; either version 2 of the Licence, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public Licence for more details.
- *
- * You should have received a copy of the GNU General Public Licence
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
- /* RISC OS library files */
- #include "toolbox.h"
- #include "fileinfo.h"
- #include "event.h"
-
- /* My library files */
- #include "err.h"
- #include "msgtrans.h"
- #include "Macros.h"
-
- /* Local headers */
- #include "EditSky.h"
- #include "SFSFileInfo.h"
-
- ObjectId fileinfo_sharedid = NULL_ObjectId;
-
- /* ----------------------------------------------------------------------- */
- /* Function prototypes */
-
- static ToolboxEventHandler _FileInfo_abouttoopen;
-
- /* ----------------------------------------------------------------------- */
- /* Public functions */
-
- void FileInfo_initialise(IdBlock *id_block)
- {
- fileinfo_sharedid = id_block->self_id;
-
- /* file type is constant */
- EF(fileinfo_set_file_type(0, fileinfo_sharedid, FILETYPE_SKYCOLS));
-
- EF(event_register_toolbox_handler(fileinfo_sharedid, FileInfo_AboutToBeShown, _FileInfo_abouttoopen, NULL));
- }
-
- /* ----------------------------------------------------------------------- */
- /* Private functions */
-
- static int _FileInfo_abouttoopen(int event_code, ToolboxEvent *event, IdBlock *id_block, void *handle)
- {
- ViewData *view_data;
-
- E_RETV(toolbox_get_client_handle(0, id_block->ancestor_id, (void **)&view_data), 1);
-
- /* Set up contents */
- RE(fileinfo_set_file_size(0, fileinfo_sharedid, sizeof(SF_SkyColours)));
- RE(fileinfo_set_modified(0, id_block->self_id, view_data->changed_since_save));
- RE(fileinfo_set_file_name(0, id_block->self_id, view_data->last_savepath));
- RE(fileinfo_set_date(0, id_block->self_id, view_data->file_date));
-
- return 1; /* claim event */
- }
-